//
//  CXChangeColorCollectionViewCell.m
//  GiftThat
//
//  Created by ChuXiang on 16/1/16.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "CXChangeColorCollectionViewCell.h"
@interface CXChangeColorCollectionViewCell ()
@property (nonatomic, strong) UIImageView *colorImage;
@property (nonatomic, strong) UILabel *colorLabel;
@end
@implementation CXChangeColorCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.colorImage = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.colorImage.backgroundColor = [UIColor whiteColor];
//        self.colorImage.image = [UIImage imageNamed:@"redColor"];
        [self addSubview:self.colorImage];
        
        self.colorLabel = [UILabel new];
        self.colorLabel.frame = CGRectZero;
        [self.colorLabel setFont:[UIFont fontWithName:@"FZLanTingHei-EL-GBK" size:15]];
        [self addSubview:self.colorLabel];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    [super applyLayoutAttributes:layoutAttributes];
    self.colorImage.frame = CGRectMake(5, 0, self.width, self.height - 30);
    self.colorLabel.frame = CGRectMake(10, self.colorImage.bottom + 5, self.width, 20);
}

- (void)setMutableArray:(NSString *)imageName WithLabelArray:(NSString *)labelText{
    self.colorImage.image = [UIImage imageNamed:imageName];
    self.colorLabel.text = labelText;
    
}
@end
